package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 交易类型（1-邀请链接入驻，2-自主升级商家，3-开通/续费会员，4-充值次卡，5-发布活动）
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum ActiveCountTradeTypeEnum {

    INVITE_URL_ENTER(1, "邀请链接入驻"),
    OWN_ENTER(2, "自主升级商家"),
    MEMBER_FEE(3, "开通/续费会员"),
    MEMBER_CARD(4, "充值次卡"),
    RELEASE_ACTIVE(5, "发布活动"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    ActiveCountTradeTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static ActiveCountTradeTypeEnum typeOf(Integer value) {
        ActiveCountTradeTypeEnum[] values = ActiveCountTradeTypeEnum.values();
        for (ActiveCountTradeTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static ActiveCountTradeTypeEnum typeOf(String name) {
        ActiveCountTradeTypeEnum[] values = ActiveCountTradeTypeEnum.values();
        for (ActiveCountTradeTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
